﻿@{
    ViewBag.Title = "info";
}
@if(false)
{
    <script src="../../Scripts/jquery-1.5.1-vsdoc.js" type="text/javascript" />
}

<script type="text/javascript">
    $(document).ready(function () {
        $.validator.addMethod("phoneUS", function (phone_number, element) {
            phone_number = phone_number.replace(/\s+/g, "");
            return this.optional(element) || phone_number.length > 9 &&
		phone_number.match(/^(1-?)?(\([2-9]\d{2}\)|[2-9]\d{2})-?[2-9]\d{2}-?\d{4}$/);
        }, "Please enter a valid phone number");

        $("#sign-in-form").validate
        (
          {
//              submitHandler: function (form) {
//                  var visited = $.cookie("visited");
//                  if (!visited) {
//                      $.cookie("visited", true, { expires: 120 });
//                      form.submit();
//                  }
//                  else {
//                      alert("You cannot submit your information more than once.");
//                  }
//              },

              messages: {
                  first_name: "Please enter first name.",
                  last_name: "Please enter last name.",
                  company: "Please enter a company name.",
                  email: "Please enter a valid email address."
              }
          }
        );

    }
 );
 
</script>

<div id="contentHome">
	<h1>Please fill out the following information as a courtesy.</h1>
    <h2>(*) indicates a required field.</h2>
    <form id="sign-in-form" name="sign-in-form" action="https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8" method="post" >
        <input name="retURL" type="hidden" value="@Url.Content(@ViewBag.File)" />
        <input name="oid" type="hidden" value="" />
        <table border="0" cellspacing="1">
            <tr class="formLabel">
                <td><label for="first_name">First Name:</label></td>
                <td>*</td>
                <td><input id="first_name" maxlength="80" name="first_name" size="20" type="text" class="required"  />
                </td>
            </tr>
            <tr class="formLabel">
                <td><label for="last_name">Last Name:</label></td>
                <td>*</td>
                <td><input id="last_name" maxlength="80" name="last_name" size="20" type="text" class="required" /></td>
            </tr>
            <tr class="formLabel">
                <td><label for="title">Title:</label></td>
                <td></td>
                <td><input id="title" maxlength="80" name="title" size="20" type="text" /></td>
            </tr>
            <tr class="formLabel">
                <td><label for="compnay">Company:</label></td>
                <td>*</td>
                <td><input id="company" maxlength="80" name="company" size="20" type="text" class="required" /></td>
            </tr>
            <tr class="formLabel">
                <td><label for="email">Email:</label></td>
                <td>*</td>
                <td><input id="email" maxlength="80" name="email" size="20" type="text" class="required email" /></td>
            </tr>
            <tr class="formLabel">
                <td><label for="phone">Phone:</label></td>
                <td></td>
                <td><input id="phone" maxlength="80" name="phone" size="20" type="text" class="phoneUS" /></td>
            </tr>
            <tr class="formLabel">
                <td colspan="2"></td>
                <td><input alt="Submit this form"  type="submit" /></td>
            </tr>
        </table>
    </form>
</div>
